package ua.org.nuos.sdms.middle.util;

import javax.persistence.EntityNotFoundException;

/**
 * Created by IntelliJ IDEA.
 * User: dio
 * Date: 09.10.11
 * Time: 21:17
 * To change this template use File | Settings | File Templates.
 */
public class EntityValidator {

    public static void checkExisting(Object entity, long id) throws EntityNotFoundException {
        if (entity == null) {
            throw new EntityNotFoundException(String.valueOf(id));
        }
    }

    public static void checkExisting(Object entity, String id) throws EntityNotFoundException {
        if (entity == null) {
            throw new EntityNotFoundException(id);
        }
    }

}
